In some manufacturing processes, a wet cleaning process may be performed to remove residues from a semiconductor device. Such wet cleaning process typically uses an aqueous HF (Hydrofluoric acid) solution or other proper HF-based solutions. Such chemical solutions may lead to corrosion in some metal lines in the semiconductor device, due to the phenomenon of galvanic corrosion. Galvanic corrosion refers to an electrochemical process in which one metal corrodes preferentially to another when both metals are in electrical contact, in the presence of an electrolyte. Since a metal line acts as an anode and thus is subjected to a forced and unwanted oxidation during electrolytic solution (e.g., HF) treatment, the metal line is liable to corrosion.